<?php

namespace App\Providers;

use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        // Registered::class => [
        //     SendEmailVerificationNotification::class,
        // ],
        // 'Illuminate\Database\Events\QueryExecuted' => [
        //     'App\Listeners\DBQueryListener',
        // ],
        // APK 上传成功
        'App\Events\ApkUploaded' => [
            'App\Listeners\MakeApkDownloadJson',
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        // 调试模式时记录SQL日志
       if (config('admin.log_sql_enabled')) {
           Event::listen('Illuminate\Database\Events\QueryExecuted', \App\Listeners\DBQueryListener::class);
       }
    }
}
